package reco.frame.demo.sample;

import com.umeng.analytics.MobclickAgent;

import reco.frame.demo.R;
import reco.frame.tv.TvBitmap;
import reco.frame.tv.view.TvButton;
import reco.frame.tv.view.TvImageView;
import reco.frame.tv.view.TvRelativeLayout;
import android.os.Bundle;
import android.app.Activity;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;

public class TvBitmapActivity extends Activity {

	private final String TAG = "TvBitmapActivity";
	private RelativeLayout rl_root;
	private ImageView iv_image;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_bitmap);
		rl_root = (RelativeLayout) findViewById(R.id.rl_root);
		iv_image = (ImageView) findViewById(R.id.iv_image);

	}

	@Override
	protected void onResume() {
		MobclickAgent.onResume(this);
		super.onResume();
	}

	@Override
	protected void onPause() {
		MobclickAgent.onPause(this);
		super.onPause();
	}

	/**
	 * 一行代码完成加载 此URL来源网络 如失效劳烦自行替换
	 * 
	 * @param v
	 */
	public void loadImage(View v) {
		
		/**
		 * 此方法用于加载普清图(小于半屏)
		 */
		TvBitmap.create(this).display(iv_image, 
				"http://img.kejixun.com/2013/1126/20131126113620100.jpg");
		
		/**
		 * 此方法用于加载超高清图
		 */
		TvBitmap.create(this).displayHD(rl_root,
				"http://pic2.52pk.com/files/130709/1288606_102316_8511.jpg");

	}

}
